package com.zqh.myfmmall.vo;

import com.zqh.myfmmall.entity.OrderItem;
import com.zqh.myfmmall.entity.Orders;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class OrdersVO{
    private String orderId;
    private String receiverName;
    private String receiverMobile;
    private String receiverAddress;
    private BigDecimal totalAmount;
    private BigDecimal actualAmount;
    private Integer payType;
    private String orderRemark;
    private Integer status;
    private String deliveryType;
    private String deliveryFlowId;
    private BigDecimal orderFreight;
    private LocalDateTime deliveryTime;
    private LocalDateTime finishTime;
    private LocalDateTime cancelTime;
    private List<OrderItem> orderItems;

    public OrdersVO(Orders orders, List<OrderItem> orderItems){
        this.orderId = orders.getOrderId();
        this.receiverName = orders.getReceiverName();
        this.receiverMobile = orders.getReceiverMobile();
        this.receiverAddress = orders.getReceiverAddress();
        this.totalAmount = orders.getTotalAmount();
        this.actualAmount = orders.getActualAmount();
        this.payType = orders.getPayType();
        this.orderRemark = orders.getOrderRemark();
        this.status = orders.getStatus();
        this.deliveryType = orders.getDeliveryType();
        this.deliveryFlowId = orders.getDeliveryFlowId();
        this.orderFreight = orders.getOrderFreight();
        this.deliveryTime = orders.getDeliveryTime();
        this.finishTime = orders.getFinishTime();
        this.cancelTime = orders.getCancelTime();
        this.orderItems = orderItems;
    }
}
